#ifndef SINGLETON_H
#define SINGLETON_H

#include <boost/shared_ptr.hpp>

template<typename T>
class ISingleton
{
public:
	typedef boost::shared_ptr<T> Ptr;
	static Ptr getInstace()
	{
		if(instance_.get() == NULL){ instance_ = Ptr(new T()); }
		return instance_;
	}

private:
	static Ptr instance_;
};

#define SingletonSurpportImp(T) \
template<> \
boost::shared_ptr<T> ISingleton<T>::instance_ = T::getInstace()

#endif